#include <nxos.h>

void NX_TimePrint(NX_Time * time)
{
    char *weekDay[] = {
        "Sunday",
        "Monday",
        "Tuesday",
        "Wednesday",
        "Thursday",
        "Friday",
        "Saturday"
    };
    
    NX_Printf("time:%d:%d:%d date:%d/%d/%d\n",
        time->hour, time->minute, time->second,
        time->year + NX_TIME_YEAR_BASE, time->month + 1, time->day);
    NX_Printf("week day:%d %s year day:%d\n", 
        time->weekDay, weekDay[time->weekDay], time->yearDay);
}

NX_Error PowerBoxBuiltinTime(int argc, char *argv[], char * env)
{
    NX_Time time;
    NX_TimeGet(&time);
    NX_TimePrint(&time);
    return NX_EOK;
}
